Skip to content

improved printing, added INCLUDE#26

Merged
Zac-HD merged 1 commit intopython-trio:mainfrom
jakkdl:diffing_message_printing
Aug 7, 2022
Merged

improved printing, added INCLUDE#26
Zac-HD merged 1 commit intopython-trio:mainfrom
jakkdl:diffing_message_printing

Conversation

@jakkdl
Copy link
Copy Markdown
Member

@jakkdl jakkdl commented Aug 7, 2022

Forked off from #17 for a smaller diff

@Zac-HD Zac-HD merged commit dc2cc8a into python-trio:main Aug 7, 2022
@jakkdl jakkdl deleted the diffing_message_printing branch August 23, 2022 12:29
Zac-HD added a commit that referenced this pull request May 1, 2026
* Fix ASYNC200 regression on `foo("x").bar` patterns (#26.4.2)

The canonical-qualname resolver introduced in 26.4.1 recursed through
ast.Call/cst.Call unconditionally, which collapsed nested calls inside an
attribute chain into a dotted name (e.g. `read_session("a").get` resolved
to `read_session.get`). This caused user-configured ASYNC200 patterns
like `*session.get` to flag method calls on the return value of an
unrelated function -- a false positive that did not exist in 25.5.3.

Only unwrap Call at the outermost position; calls inside an attribute
chain now make the whole expression unresolvable (None), since the
target of the trailing attribute is a return value we can't determine
statically. Top-level shapes like `trio.open_nursery()` still resolve
as before.

Adds:
  - eval-file regression case in tests/eval_files/async200.py
  - direct unit test for resolve_canonical_ast / resolve_canonical_cst
  - changelog entry for 26.4.2 and version bump

https://claude.ai/code/session_01BWheK2fZPMDhbfS1LCR2zc

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Satisfy pre-commit: hoist import + black reformat

- Move `resolve_canonical_ast` / `resolve_canonical_cst` import to the top
  of tests/test_flake8_async.py (ruff PLC0415 / import-not-at-top).
- Black reformat of `_resolve_attr_chain_ast` signature.

https://claude.ai/code/session_01BWheK2fZPMDhbfS1LCR2zc

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants